import { EXAMPLES_COUNTER_PLUS_ONE } from './constants';

export const counterPlusOne = () => {
  return {
    type: EXAMPLES_COUNTER_PLUS_ONE
  }
}

export const reducer = (state: any, action: any) => {
  switch(action.type) {
    case EXAMPLES_COUNTER_PLUS_ONE:
      return {
        ...state,
        count: state.count + 1
      }
    default: 
      return state;
  }
}